package com.lyncs.ods.resp;

import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import com.lyncs.ods.modules.txn.model.TagInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author alex
 * @date 2022-05-06 14:38
 */
@Data
@Accessors(chain = true)
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
public class DeliverSkuLogResp {

    @ApiModelProperty(value = "交付单创建企业信息")
    private CompanyShortInfoResp companyInfo;

    @ApiModelProperty(value = "交付时间")
    private LocalDate deliverTime;

    @ApiModelProperty(value = "本交付单关联的订单数量")
    private Integer orderCount;

    @ApiModelProperty(value = "订单交付信息")
    private List<OrderDeliverInfo> orderInfos;

    @ApiModelProperty(value = "sku信息")
    private SkuInfo skuInfo;

    @Data
    @Accessors(chain = true)
    @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
    public static class OrderDeliverInfo {

        @ApiModelProperty(value = "订单ID")
        private Long orderId;

        @ApiModelProperty(value = "订单名称")
        private String orderName;

        @ApiModelProperty(value = "sku种类数量")
        private Integer skuCount;

        @ApiModelProperty("标签信息")
        private List<TagInfo> tagInfos;

        @ApiModelProperty(value = "交付单中此sku总金额")
        private BigDecimal deliverAmount;
    }

    @Data
    @EqualsAndHashCode(callSuper = true)
    @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
    public static class SkuInfo extends SkuInfoResp {
        @ApiModelProperty(value = "已交付数")
        private BigDecimal deliveredCount;
        @ApiModelProperty(value = "订单ID")
        private Long orderId;
        @ApiModelProperty(value = "订单名称")
        private String orderName;
    }
}
